package com.lxq.rental.common.config;
/**
 * @description:
 * @author: LuoXiaoQiang
 * @date: 5/10/2025 1:48 AM
 * Copyright (c) 2025, LXQ Cloud All Rights Reserved.
 */

import com.lxq.rental.common.dto.ResponseDTO;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionAdvice {

    @ExceptionHandler(Exception.class)
    public ResponseDTO<String> handleException(Exception ex) {
        return ResponseDTO.error(HttpStatus.INTERNAL_SERVER_ERROR.value(), ex.getMessage());
    }
}